package com.iran.calculator.simpleFactory;

public class FactoryCash {
    public static SuperCash createCashAccept(String type) {
        SuperCash superCash;
        switch (type) {
            case "打八折":
                superCash = new RebateCash(0.8d);
                break;
            case "打七折":
                superCash = new RebateCash(0.7d);
                break;
            case "满三百减一百":
                superCash = new ReturnCash(300d, 100d);
                break;
            default:
                superCash = new NormalCash();
                break;
        }
        return superCash;
    }
}
